exports.searchAtomicApiDetail = function (req, res) {

    //获取restful参数
    var restfulParams = req.routeInfo.restfulParams;

    //返回结果
    var resultData = {};

    //保存请求参数
    var requestParamsData = [];

    //任务流创建
    async.waterfall([

        //查询接口详情信息
        (cb) => {

            
            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.actionPermissionsSearch.Request_Api_Url + "/ap_id/"+ restfulParams.ap_id,
                    method : 'GET'
                },
                function (data) {

                    resultData.apiData = data.result.data[0];
                    
                    cb();
                    
                }
            )


        },
        
        //查询该接口的请求参数信息
        (cb) => {

            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.requestParameterSearch.Request_Api_Url + "/rp_apid/"+ restfulParams.ap_id,
                    method : 'GET'
                },
                function (data) {

                    requestParamsData = data.result.data;
                    
                    cb();
                    
                }
            )

         
            
            
        },

       //根据请求参数拆分POST和GET请求数组
       (cb) => {

        var postArr = [];
        var getArr  = [];

        for(var i = 0;i<requestParamsData.length;i++){

            if(requestParamsData[i].rp_way == 'BODY'){
                postArr.push(requestParamsData[i])
            }else{
                getArr.push(requestParamsData[i])
            }

        }

        resultData.postArr = postArr;
        resultData.getArr  = getArr;

        cb();
        
    }

    ],()=> {

        //返回最终拼接结果
        RES.successResponse(res, resultData);

    });

}